<template>
  <span>文章标题：</span>
  <el-input v-model="title" style="width: 240px" placeholder="请输入标题" />
  <br />
  <span>内容：</span>
  <el-input v-model="content" style="width: 240px" :rows="2" type="textarea" placeholder="请输入内容" />
  <br />
  <el-switch v-model="status" inactive-text="是否公开" />
  <br />
  <el-button type="primary" @click="fabu">发布</el-button>
  <el-button type="danger" @click="reset">重置</el-button>
</template>
<script setup lang="ts">
import { WenzhangAddRequset } from '@/api/user';
import { ref } from 'vue';
const title = ref('');
const content = ref("");
const status = ref(true);
async function fabu() {
  const res = await WenzhangAddRequset(title.value, content.value, status.value);
  console.log(res);

}
function reset() {
  title.value = '';
  content.value = '';
  status.value = false;
}
</script>
<style lang="css" scoped></style>
